var data=[{
    "imgPath":"./images/adv1.jpg",
    "title":"#我要上首焦#懒人版荷包蛋焖面by短妈美食记◎"
},
{
    "imgPath":"./images/adv1.jpg",
    "title":"#我要上首焦#懒人版荷包蛋焖面by短妈美食记◎"
},
{
    "imgPath":"./images/adv1.jpg",
    "title":"#我要上首焦#懒人版荷包蛋焖面by短妈美食记◎"
},
{
    "imgPath":"./images/adv1.jpg",
    "title":"#我要上首焦#懒人版荷包蛋焖面by短妈美食记◎"
},
{
    "imgPath":"./images/adv1.jpg",
    "title":"#我要上首焦#懒人版荷包蛋焖面by短妈美食记◎"
},
{
    "imgPath":"./images/adv1.jpg",
    "title":"#我要上首焦#懒人版荷包蛋焖面by短妈美食记◎"
},
{
    "imgPath":"./images/adv1.jpg",
    "title":"#我要上首焦#懒人版荷包蛋焖面by短妈美食记◎"
},
{
    "imgPath":"./images/adv1.jpg",
    "title":"#我要上首焦#懒人版荷包蛋焖面by短妈美食记◎"
}
]
window.onload=function(){
    initData()
}
function initData(){
    var selections=document.querySelector('.selections')
    var strHtml=''
    for(var i=0;i<data.length;i++){
        if(data[i]){
            strHtml +=` <div class="selection">
            <img src="${data[i].imgPath}">
            <div class="title">${data[i].title}</div>
            </div>
            `

        }
    }
    selections.innerHTML +=strHtml

}